{% macro progressbar(data) %}
	<div class="progress progress-thin" role="progressbar" aria-valuenow="{{ data.percent }}">
		<div class="progress-bar {{ data.style }}" style="width: {{ data.percent }}%;"></div>
	</div>
	<div class="text-end small">
		{% if data.infotext is not empty %}
			<i class="fa-solid fa-circle-info" data-bs-trigger="hover" data-bs-toggle="popover" data-bs-placement="bottom" data-bs-html="true" data-bs-content="{{ data.infotext|raw|nl2br }}"></i>
		{% endif %}
		{{ data.text }}
	</div>
{% endmacro %}

{% macro boolean(data) %}
	{% if (data) %}
		<i class="fa-solid fa-check-circle text-success"></i>
	{% else %}
		<i class="fa-solid fa-times-circle text-danger"></i>
	{% endif %}
{% endmacro %}

{% macro booleanWithInfo(data) %}
	{% if (data.checked) %}
		<i class="fa-solid fa-check-circle text-success"></i>
	{% else %}
		<i class="fa-solid fa-times-circle text-danger"></i>
	{% endif %}
	{% if data.info is not empty %}
		{{ data.info }}
	{% endif %}
{% endmacro %}

{% macro link(data) %}
	{% apply spaceless %}
	<a href="{{ data.href }}" {% if data.class is defined %} class="{{ data.class }}" {% endif %} {% if data.target is defined %} target="{{ data.target }}" {% endif %} {% if data.title is defined %} title="{{ data.title }}" {% endif %}>
		{% if data.icon is defined %}
			<i class="{{ data.icon }}"></i>
		{% endif %}
		{% if data.text is defined %}
			{{ data.text }}
		{% endif %}
	</a>
	{% endapply %}
{% endmacro %}

{% macro button(data) %}
	{% apply spaceless %}
	<{% if data.href is defined %}a{% else %}span{% endif %} class="{% if data.class is defined %}btn btn-sm {{ data.class }}{% else %}btn btn-sm btn-outline-secondary{% endif %}" {% if data.modal is defined and data.modal is iterable %} data-bs-toggle="modal" role="button" href="#{{ data.modal.id }}" {% else %} {% if data.href is defined %}href="{{ data.href }}"{% endif %} {% endif %} {% if data.target is defined %} target="{{ data.target }}" {% endif %} {% if data.title is defined %} title="{{ data.title }}" {% endif %}>
		{% if data.icon is defined %}
			<i class="{{ data.icon }}"></i>
		{% endif %}
		{% if data.text is defined %}
			{{ data.text }}
		{% endif %}
	</{% if data.href is defined %}a{% else %}span{% endif %}>
	{% if data.modal is defined and data.modal is iterable %}
		<div class="modal fade" data-action="{{ data.modal.action|default('') }}" data-entry="{{ data.modal.entry }}" id="{{ data.modal.id }}" aria-hidden="true" aria-labelledby="{{ data.modal.id }}Label" tabindex="-1">
			<div class="modal-dialog {{ data.modal.size|default('modal-xl') }} modal-dialog-centered">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title" id="{{ data.modal.id }}Label">{{ data.modal.title }}</h5>
						<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ lng('panel.modalclose') }}"></button>
					</div>
					<div class="modal-body text-start">
						{{ data.modal.body|raw }}
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-primary" data-bs-dismiss="modal">{{ lng('panel.modalclose') }}</button>
					</div>
				</div>
			</div>
		</div>
	{% endif %}
	{% endapply %}
{% endmacro %}

{% macro domainWithSan(data) %}
	{{ data.domain }}
	{% if data.san is not empty %}
		<br/>
		<span class="small">
			SAN: {{ data.san }}
		</span>
	{% endif %}
{% endmacro %}

{% macro actions(data) %}
	{% for action in data %}
		{% if action.visible is not defined or action.visible is defined and action.visible %}
			{{ _self.button(action) }}
		{% endif %}
	{% endfor %}
{% endmacro %}
